<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./vue.2.5.1.js"></script>
</head>

<body>

    <div id="app">
        <div>
            <todo-item v-for='todo in groceryList' :todo='todo' v-bind:key='todo.id' id='sky'></todo-item>
        </div>

    </div>

    <script>
        Vue.component('todo-item', {
            props: ['todo'],
            template: '<li>{{todo.text}}</li>'
        })
        var data = {
            a: 1
        }
        var vm = new Vue({
            el: '#app',
            data: data

        });
        vm.$data === data // => true
        vm.$el === document.getElementById('example') // => true
        vm.$watch('a', function(newValue, oldValue) {
            // 这个回调将在 `vm.a` 改变后调用
        })
    </script>
</body>